package com.guchenbo.spark.sql

import com.guchenbo.spark.sql.SparkJdbcUtils.mysqlTd
import org.apache.spark.sql.SparkSession


/**
 * mysql 外表查询
 */
object MySqlExternalRead {

  def main(args: Array[String]): Unit = {
    val spark = SparkUtils.sparkSessionTd("Spark Sql")

    // 创建外表
    createTable(spark,"model_info")
    // 查询外表

    // insert select

    // select view insert

  }

  def createTable(spark: SparkSession,tableName:String): Unit = {
    var sparkJdbcOption = mysqlTd
    var dropSql = ""
    var createSql=
      """
        |CREATE TABLE IF NOT EXISTS turing.gcb_mysql_model_info USING jdbc OPTIONS ()
        |""".stripMargin
  }
}
